<html>
<head><meta charset="utf-8"><title>log output when running tests · t-compiler/help · Zulip Chat Archive</title></head>
<h2>Stream: <a href="https://rust-lang.github.io/zulip_archive/stream/182449-t-compiler/help/index.html">t-compiler/help</a></h2>
<h3>Topic: <a href="https://rust-lang.github.io/zulip_archive/stream/182449-t-compiler/help/topic/log.20output.20when.20running.20tests.html">log output when running tests</a></h3>

<hr>

<base href="https://rust-lang.zulipchat.com">

<head><link href="https://rust-lang.github.io/zulip_archive/style.css" rel="stylesheet"></head>

<a name="234362279"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/182449-t-compiler/help/topic/log%20output%20when%20running%20tests/near/234362279" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Tor Hovland <a href="https://rust-lang.github.io/zulip_archive/stream/182449-t-compiler/help/topic/log.20output.20when.20running.20tests.html#234362279">(Apr 13 2021 at 16:52)</a>:</h4>
<p>Hi!</p>
<p>I can't figure out how to enable debug logging while running rustdoc tests. I get plenty of logging if I do</p>
<div class="codehilite"><pre><span></span><code>RUSTDOC_LOG=trace ./x.py doc library/std
</code></pre></div>
<p>But when I do</p>
<div class="codehilite"><pre><span></span><code>RUST_LOG=trace RUSTDOC_LOG=trace ./x.py test src/test/rustdoc
</code></pre></div>
<p>I only get a little logging like this</p>
<div class="codehilite"><pre><span></span><code>DEBUG compiletest: found test file: &quot;/home/tor/projects/rust/src/test/rustdoc/description_default.rs&quot;
</code></pre></div>
<p>I have these set in my <code>config.toml</code>:</p>
<div class="codehilite"><pre><span></span><code>debug = true
debug-logging = true
debug-assertions = true
</code></pre></div>



<a name="234362695"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/182449-t-compiler/help/topic/log%20output%20when%20running%20tests/near/234362695" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Joshua Nelson <a href="https://rust-lang.github.io/zulip_archive/stream/182449-t-compiler/help/topic/log.20output.20when.20running.20tests.html#234362695">(Apr 13 2021 at 16:55)</a>:</h4>
<p>if you remove RUST_LOG does it show output?</p>



<a name="234363078"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/182449-t-compiler/help/topic/log%20output%20when%20running%20tests/near/234363078" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Tor Hovland <a href="https://rust-lang.github.io/zulip_archive/stream/182449-t-compiler/help/topic/log.20output.20when.20running.20tests.html#234363078">(Apr 13 2021 at 16:57)</a>:</h4>
<p>If I do</p>
<div class="codehilite"><pre><span></span><code>RUSTDOC_LOG=trace ./x.py test src/test/rustdoc
</code></pre></div>
<p>I only get</p>
<div class="codehilite"><pre><span></span><code>Updating only changed submodules
Submodules updated in 0.02 seconds
    Finished dev [unoptimized + debuginfo] target(s) in 0.11s
Building stage0 std artifacts (x86_64-unknown-linux-gnu -&gt; x86_64-unknown-linux-gnu)
    Finished release [optimized + debuginfo] target(s) in 0.11s
Copying stage0 std from stage0 (x86_64-unknown-linux-gnu -&gt; x86_64-unknown-linux-gnu / x86_64-unknown-linux-gnu)
Building stage0 compiler artifacts (x86_64-unknown-linux-gnu -&gt; x86_64-unknown-linux-gnu)
    Finished release [optimized + debuginfo] target(s) in 0.15s
Copying stage0 rustc from stage0 (x86_64-unknown-linux-gnu -&gt; x86_64-unknown-linux-gnu / x86_64-unknown-linux-gnu)
Assembling stage1 compiler (x86_64-unknown-linux-gnu)
Building stage1 std artifacts (x86_64-unknown-linux-gnu -&gt; x86_64-unknown-linux-gnu)
    Finished release [optimized + debuginfo] target(s) in 0.10s
Copying stage1 std from stage1 (x86_64-unknown-linux-gnu -&gt; x86_64-unknown-linux-gnu / x86_64-unknown-linux-gnu)
Building stage0 tool compiletest (x86_64-unknown-linux-gnu)
    Finished release [optimized + debuginfo] target(s) in 0.11s
Building rustdoc for stage1 (x86_64-unknown-linux-gnu)
    Finished release [optimized + debuginfo] target(s) in 0.12s
Check compiletest suite=rustdoc mode=rustdoc (x86_64-unknown-linux-gnu -&gt; x86_64-unknown-linux-gnu)
warning: `tidy` is not installed; diffs will not be generated

running 430 tests
iiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiii 100/430
iiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiii 200/430
iiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiii 300/430
iiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiii 400/430
iiiiiiiiiiiiiiiiiiiiiiiiii....
test result: ok. 4 passed; 0 failed; 426 ignored; 0 measured; 0 filtered out; finished in 0.34s

        finished in 0.412 seconds
Build completed successfully in 0:00:01
</code></pre></div>



<a name="234363181"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/182449-t-compiler/help/topic/log%20output%20when%20running%20tests/near/234363181" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Joshua Nelson <a href="https://rust-lang.github.io/zulip_archive/stream/182449-t-compiler/help/topic/log.20output.20when.20running.20tests.html#234363181">(Apr 13 2021 at 16:58)</a>:</h4>
<p>I think the test suite hides output if the test succeeds, it's really annoying</p>



<a name="234363204"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/182449-t-compiler/help/topic/log%20output%20when%20running%20tests/near/234363204" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Joshua Nelson <a href="https://rust-lang.github.io/zulip_archive/stream/182449-t-compiler/help/topic/log.20output.20when.20running.20tests.html#234363204">(Apr 13 2021 at 16:58)</a>:</h4>
<p>you could make it intentionally fail to see the output</p>



<a name="234367204"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/182449-t-compiler/help/topic/log%20output%20when%20running%20tests/near/234367204" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Tor Hovland <a href="https://rust-lang.github.io/zulip_archive/stream/182449-t-compiler/help/topic/log.20output.20when.20running.20tests.html#234367204">(Apr 13 2021 at 17:22)</a>:</h4>
<p>Unfortunately, it still isn't showing any log output.</p>



<a name="234367267"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/182449-t-compiler/help/topic/log%20output%20when%20running%20tests/near/234367267" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Joshua Nelson <a href="https://rust-lang.github.io/zulip_archive/stream/182449-t-compiler/help/topic/log.20output.20when.20running.20tests.html#234367267">(Apr 13 2021 at 17:22)</a>:</h4>
<p>can you post the exact output you're seeing?</p>



<a name="234367419"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/182449-t-compiler/help/topic/log%20output%20when%20running%20tests/near/234367419" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Tor Hovland <a href="https://rust-lang.github.io/zulip_archive/stream/182449-t-compiler/help/topic/log.20output.20when.20running.20tests.html#234367419">(Apr 13 2021 at 17:23)</a>:</h4>
<div class="codehilite"><pre><span></span><code>running 430 tests
iiiii.ii.i..i.iii.....i...ii..ii.ii.ii................ii....ii.ii.i.iii.iii..iii...ii.ii..i....i.... 100/430
.................................................................................................... 200/430
.................................................................................................... 300/430
..F.....................................................i........................................... 400/430
..............................
failures:

---- [rustdoc] rustdoc/issue-83832.rs stdout ----

error: htmldocck failed!
status: exit status: 1
command: &quot;/usr/bin/python&quot; &quot;/home/tor/projects/rust/src/etc/htmldocck.py&quot; &quot;/home/tor/projects/rust/build/x86_64-unknown-linux-gnu/test/rustdoc/issue-83832&quot; &quot;/home/tor/projects/rust/src/test/rustdoc/issue-83832.rs&quot;
stdout:
------------------------------------------

------------------------------------------
stderr:
------------------------------------------
24: @has check failed
        `XPATH PATTERN` did not match
            // @has - &#39;//code&#39; &#39;pub use tag::Portabilityx;&#39;

Encountered 1 errors

------------------------------------------



failures:
    [rustdoc] rustdoc/issue-83832.rs

test result: FAILED. 385 passed; 1 failed; 44 ignored; 0 measured; 0 filtered out; finished in 84.88s

Some tests failed in compiletest suite=rustdoc mode=rustdoc host=x86_64-unknown-linux-gnu target=x86_64-unknown-linux-gnu


command did not execute successfully: &quot;/home/tor/projects/rust/build/x86_64-unknown-linux-gnu/stage0-tools-bin/compiletest&quot; &quot;--compile-lib-path&quot; &quot;/home/tor/projects/rust/build/x86_64-unknown-linux-gnu/stage1/lib&quot; &quot;--run-lib-path&quot; &quot;/home/tor/projects/rust/build/x86_64-unknown-linux-gnu/stage1/lib/rustlib/x86_64-unknown-linux-gnu/lib&quot; &quot;--rustc-path&quot; &quot;/home/tor/projects/rust/build/x86_64-unknown-linux-gnu/stage1/bin/rustc&quot; &quot;--rustdoc-path&quot; &quot;/home/tor/projects/rust/build/x86_64-unknown-linux-gnu/stage1/bin/rustdoc&quot; &quot;--src-base&quot; &quot;/home/tor/projects/rust/src/test/rustdoc&quot; &quot;--build-base&quot; &quot;/home/tor/projects/rust/build/x86_64-unknown-linux-gnu/test/rustdoc&quot; &quot;--stage-id&quot; &quot;stage1-x86_64-unknown-linux-gnu&quot; &quot;--suite&quot; &quot;rustdoc&quot; &quot;--mode&quot; &quot;rustdoc&quot; &quot;--target&quot; &quot;x86_64-unknown-linux-gnu&quot; &quot;--host&quot; &quot;x86_64-unknown-linux-gnu&quot; &quot;--llvm-filecheck&quot; &quot;/home/tor/projects/rust/build/x86_64-unknown-linux-gnu/ci-llvm/bin/FileCheck&quot; &quot;--nodejs&quot; &quot;/usr/bin/node&quot; &quot;--npm&quot; &quot;/usr/local/bin/npm&quot; &quot;--host-rustcflags&quot; &quot;-Crpath -O -Cdebuginfo=0 -Zunstable-options  -Lnative=/home/tor/projects/rust/build/x86_64-unknown-linux-gnu/native/rust-test-helpers&quot; &quot;--target-rustcflags&quot; &quot;-Crpath -O -Cdebuginfo=0 -Zunstable-options  -Lnative=/home/tor/projects/rust/build/x86_64-unknown-linux-gnu/native/rust-test-helpers&quot; &quot;--docck-python&quot; &quot;/usr/bin/python&quot; &quot;--lldb-python&quot; &quot;/usr/bin/python&quot; &quot;--gdb&quot; &quot;/usr/bin/gdb&quot; &quot;--quiet&quot; &quot;--llvm-version&quot; &quot;12.0.0-rust-1.53.0-nightly&quot; &quot;--llvm-components&quot; &quot;aarch64 aarch64asmparser aarch64codegen aarch64desc aarch64disassembler aarch64info aarch64utils aggressiveinstcombine all all-targets analysis arm armasmparser armcodegen armdesc armdisassembler arminfo armutils asmparser asmprinter avr avrasmparser avrcodegen avrdesc avrdisassembler avrinfo binaryformat bitreader bitstreamreader bitwriter cfguard codegen core coroutines coverage debuginfocodeview debuginfodwarf debuginfogsym debuginfomsf debuginfopdb demangle dlltooldriver dwarflinker engine executionengine extensions filecheck frontendopenacc frontendopenmp fuzzmutate globalisel hellonew hexagon hexagonasmparser hexagoncodegen hexagondesc hexagondisassembler hexagoninfo instcombine instrumentation interfacestub interpreter ipo irreader jitlink libdriver lineeditor linker lto mc mca mcdisassembler mcjit mcparser mips mipsasmparser mipscodegen mipsdesc mipsdisassembler mipsinfo mirparser msp430 msp430asmparser msp430codegen msp430desc msp430disassembler msp430info native nativecodegen nvptx nvptxcodegen nvptxdesc nvptxinfo objcarcopts object objectyaml option orcjit orcshared orctargetprocess passes powerpc powerpcasmparser powerpccodegen powerpcdesc powerpcdisassembler powerpcinfo profiledata remarks riscv riscvasmparser riscvcodegen riscvdesc riscvdisassembler riscvinfo runtimedyld scalaropts selectiondag sparc sparcasmparser sparccodegen sparcdesc sparcdisassembler sparcinfo support symbolize systemz systemzasmparser systemzcodegen systemzdesc systemzdisassembler systemzinfo tablegen target textapi transformutils vectorize webassembly webassemblyasmparser webassemblycodegen webassemblydesc webassemblydisassembler webassemblyinfo windowsmanifest x86 x86asmparser x86codegen x86desc x86disassembler x86info xray&quot; &quot;--cc&quot; &quot;&quot; &quot;--cxx&quot; &quot;&quot; &quot;--cflags&quot; &quot;&quot; &quot;--adb-path&quot; &quot;adb&quot; &quot;--adb-test-dir&quot; &quot;/data/tmp/work&quot; &quot;--android-cross-path&quot; &quot;&quot;
expected success, got: exit code: 1


failed to run: /home/tor/projects/rust/build/bootstrap/debug/bootstrap test src/test/rustdoc
Build completed unsuccessfully in 0:01:26
</code></pre></div>



<a name="234367550"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/182449-t-compiler/help/topic/log%20output%20when%20running%20tests/near/234367550" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Joshua Nelson <a href="https://rust-lang.github.io/zulip_archive/stream/182449-t-compiler/help/topic/log.20output.20when.20running.20tests.html#234367550">(Apr 13 2021 at 17:24)</a>:</h4>
<p>ok yeah the test suite is annoying here - it only prints the stdout if the crate failed to compile, not if the checks fail</p>



<a name="234367561"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/182449-t-compiler/help/topic/log%20output%20when%20running%20tests/near/234367561" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Joshua Nelson <a href="https://rust-lang.github.io/zulip_archive/stream/182449-t-compiler/help/topic/log.20output.20when.20running.20tests.html#234367561">(Apr 13 2021 at 17:24)</a>:</h4>
<p>I would take a PR fixing that :)</p>



<a name="234368045"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/182449-t-compiler/help/topic/log%20output%20when%20running%20tests/near/234368045" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Tor Hovland <a href="https://rust-lang.github.io/zulip_archive/stream/182449-t-compiler/help/topic/log.20output.20when.20running.20tests.html#234368045">(Apr 13 2021 at 17:27)</a>:</h4>
<p>I made the test crate fail compilation, but stdout is still empty:</p>
<div class="codehilite"><pre><span></span><code>stdout:
------------------------------------------

------------------------------------------
stderr:
------------------------------------------
INFO rustdoc starting to run rustc
error: visibility `pub` is not followed by an item
  --&gt; /home/tor/projects/rust/src/test/rustdoc/issue-83832.rs:22:1
   |
22 | pub modx mod2 {
   | ^^^ the visibility
   |
   = help: you likely meant to define an item, e.g., `pub fn foo() {}`

error: expected item, found `modx`
  --&gt; /home/tor/projects/rust/src/test/rustdoc/issue-83832.rs:22:5
   |
22 | pub modx mod2 {
   |     ^^^^ expected item

error: aborting due to 2 previous errors
</code></pre></div>



<a name="234368198"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/182449-t-compiler/help/topic/log%20output%20when%20running%20tests/near/234368198" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Joshua Nelson <a href="https://rust-lang.github.io/zulip_archive/stream/182449-t-compiler/help/topic/log.20output.20when.20running.20tests.html#234368198">(Apr 13 2021 at 17:28)</a>:</h4>
<p>are you sure anything's being logged? I see the INFO log which looks correct</p>



<a name="234368217"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/182449-t-compiler/help/topic/log%20output%20when%20running%20tests/near/234368217" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Joshua Nelson <a href="https://rust-lang.github.io/zulip_archive/stream/182449-t-compiler/help/topic/log.20output.20when.20running.20tests.html#234368217">(Apr 13 2021 at 17:28)</a>:</h4>
<p>if you make the error early enough the rest of rustdoc won't run</p>



<a name="234368272"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/182449-t-compiler/help/topic/log%20output%20when%20running%20tests/near/234368272" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Joshua Nelson <a href="https://rust-lang.github.io/zulip_archive/stream/182449-t-compiler/help/topic/log.20output.20when.20running.20tests.html#234368272">(Apr 13 2021 at 17:29)</a>:</h4>
<p>I really think it would be better to fix this in the test suite</p>



<a name="234369293"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/182449-t-compiler/help/topic/log%20output%20when%20running%20tests/near/234369293" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Tor Hovland <a href="https://rust-lang.github.io/zulip_archive/stream/182449-t-compiler/help/topic/log.20output.20when.20running.20tests.html#234369293">(Apr 13 2021 at 17:35)</a>:</h4>
<p>If I'm doing this, I'm seeing the debug logging:</p>
<div class="codehilite"><pre><span></span><code>RUSTDOC_LOG=rustdoc::html::render::print_item=debug ./x.py doc library/std --stage 1
</code></pre></div>
<p>This same code is running when I run the tests, so I would expect the log output.</p>



<a name="234369560"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/182449-t-compiler/help/topic/log%20output%20when%20running%20tests/near/234369560" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Joshua Nelson <a href="https://rust-lang.github.io/zulip_archive/stream/182449-t-compiler/help/topic/log.20output.20when.20running.20tests.html#234369560">(Apr 13 2021 at 17:36)</a>:</h4>
<p>if there's a hard error during parsing, then rustdoc will never generate the HTML</p>



<a name="234369581"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/182449-t-compiler/help/topic/log%20output%20when%20running%20tests/near/234369581" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Joshua Nelson <a href="https://rust-lang.github.io/zulip_archive/stream/182449-t-compiler/help/topic/log.20output.20when.20running.20tests.html#234369581">(Apr 13 2021 at 17:36)</a>:</h4>
<p>the easy way to do this is to run <code>rustdoc +stage1</code> on the test file</p>



<a name="234370712"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/182449-t-compiler/help/topic/log%20output%20when%20running%20tests/near/234370712" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Tor Hovland <a href="https://rust-lang.github.io/zulip_archive/stream/182449-t-compiler/help/topic/log.20output.20when.20running.20tests.html#234370712">(Apr 13 2021 at 17:44)</a>:</h4>
<p>Thanks, that does work!</p>



<hr><p>Last updated: Aug 07 2021 at 22:04 UTC</p>
</html>